
let mockData = {
    name: '5，6',
    num: 5,
    duration: 6,
}

function getData (mockData, level = 3, len = 3) {
    mockData.children = []
    level--
    for (let i = 1; i <= len; i++) {
        let num = parseInt(Math.random() * 9 + 1)
        let duration = parseInt(Math.random() * 9 + 1)
        let obj = {
            name: `${num}，${duration}`,
            num,
            duration,
            children:[]
        }
        if(level>0)obj.children=getData(level)
        mockData.children.push(obj)
    }
    return mockData.children
}
getData(mockData)